package com.itheima.test2;

import java.io.*;

/*
使用缓冲流复制数据
一次复制一个数组
 */
public class Test04 {
    public static void main(String[] args) throws IOException {
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("C:\\Users\\Administrator\\Desktop\\美女\\meinv2.jpg"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("day12\\copy\\meinv4.jpg"));

        byte[] bytes = new byte[1024];
        int len;
        long start = System.currentTimeMillis();
        while ((len=bis.read(bytes))!=-1){
            bos.write(bytes,0,len);
        }
        long end = System.currentTimeMillis();
        System.out.println(end-start);//15
        bis.close();
        bos.close();



    }

}
